package com.mornd.gulimall.apis.member;

import com.mornd.gulimall.apis.member.to.MemberLoginTo;
import com.mornd.gulimall.apis.member.to.MemberReceiveAddressTo;
import com.mornd.gulimall.apis.member.to.MemberRegistTo;
import com.mornd.gulimall.common.core.entity.SessionUser;
import com.mornd.gulimall.common.core.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: mornd
 * @dateTime: 2023/8/18 - 9:01
 */

@FeignClient(value = "service-member")
public interface IMemberClient {

    @PostMapping("/member/member/regist")
    public R regist(@RequestBody MemberRegistTo to);

    @PostMapping("/member/member/login")
    public R<SessionUser> login(@RequestBody MemberLoginTo to);

    @GetMapping("/member/memberReceiveAddress/getByMemberId/{memberId}")
    R<List<MemberReceiveAddressTo>> getAddressByMemberId(@PathVariable Long memberId);

    @GetMapping("/member/memberReceiveAddress/getById/{id}")
    R<MemberReceiveAddressTo> getAddressById(@PathVariable Long id);
}
